﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML><HEAD><TITLE>询价书明细</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <SCRIPT src="https://cdn.jsdelivr.net/npm/vue@2"></SCRIPT>
    <SCRIPT src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></SCRIPT>
    <LINK href="../js/style.css" rel=stylesheet>
    <META content="MSHTML 6.00.2900.5626" name=GENERATOR></HEAD>
<BODY>
<!-- 添加一个明确的挂载点 -->
<div id="app">
    <TABLE style="LINE-HEIGHT: 30px" cellSpacing=1 cellPadding=0 width="100%"
           bgColor=#336699 borderColorLight=#006699 border=0>
        <TBODY>
        <TR>
            <TD>
                <TABLE cellSpacing=1 cellPadding=3 width="100%" border=0>
                    <TBODY>
                    <TR bgColor=#ffffff class=t1>
                        <TD align=middle width="100%" bgColor=#ffffff colSpan=20
                            height=22><B>
                            <H2><FONT color=#0070c0>询价书明细</B> <A
                                onclick="vm.QuotePrint('查询编号')"
                                href="javascript:void(null)"><IMG alt=帮助
                                                                  src="../img/help_a.gif" border=0></A>
                            </FONT></H2></TD></TR>
                    <TR class=t1>
                        <TD noWrap width="20%">询价书编号</TD>
                        <TD class=t2 noWrap>{{ Enquires.EnquireNo }}</TD>
                        <TD noWrap width="20%">询价书名称</TD>
                        <TD class=t2 noWrap>{{ Enquires.EnquireName }}</TD></TR>
                    <TR class=t1>
                        <TD noWrap width="20%">单位</TD>
                        <TD class=t2 noWrap>{{ Enquires.Company }}</TD>
                        <TD noWrap width="20%">联系人</TD>
                        <TD class=t2 noWrap>{{ Enquires.ContactPerson }}</TD></TR>
                    <TR class=t1>
                        <TD noWrap width="20%">联系地址</TD>
                        <TD class=t2 noWrap>{{ Enquires.Address }}</TD>
                        <TD noWrap width="20%">联系电话</TD>
                        <TD class=t2 noWrap>{{ Enquires.Tel }}</TD></TR>
                    <TR class=t1>
                        <TD noWrap width="20%">联系传真</TD>
                        <TD class=t2 noWrap>{{ Enquires.Fax }}</TD>
                        <TD noWrap width="20%">邮编</TD>
                        <TD class=t2 noWrap>{{ Enquires.PostCode }}</TD></TR>
                    <TR class=t1>
                        <TD noWrap width="20%">Email</TD>
                        <TD class=t2 noWrap>{{ Enquires.Email }}</TD>
                        <TD noWrap width="20%">报价截止时间</TD>
                        <TD class=t2 noWrap>{{ Enquires.Deadline }}</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
    <TABLE cellSpacing=1 cellPadding=0 width="100%" bgColor=#ffffff
           borderColorLight=#ffffff border=0>
        <TBODY>
        <TR>
            <TD>
                <TABLE cellSpacing=1 cellPadding=3 width="100%"
                       border=0><B>我公司欲采购下述物资，如贵单位有兴趣，可参与网上报价。详细物资情况如下：</B>
                    <TBODY></TBODY></TABLE></TD></TR></TBODY></TABLE>
    <TABLE style="LINE-HEIGHT: 30px" cellSpacing=1 cellPadding=0     width="100%"  bgColor=#336699 borderColorLight=#006699 border=0>
        <tr>
            <td>
                <TABLE cellSpacing=1 cellPadding=3 width="100%" border=0>
                    <TBODY>
                    <TR class=t1>
                        <TD noWrap align=middle>物资编码</TD>
                        <TD noWrap align=middle>物资名称</TD>
                        <TD noWrap align=middle>数量</TD>
                        <TD noWrap align=middle>计量<BR>单位</TD>
                        <TD noWrap align=middle>交货期</TD>
                        <TD noWrap align=middle>协议价格<BR>（元）</TD>
                        <TD noWrap align=middle>预算总金额<BR>（元）</TD>
                        <TD noWrap align=middle>计划价<BR>（元/不含税）</TD></TR>
                    <TR class=t2 v-for="item in items" :key="item.code">
                        <TD>{{ item.materialCode }}</TD>
                        <TD>{{ item.materialName }}</TD>
                        <TD align=right>{{ item.amount }}</TD>
                        <TD>{{ item.measureUnit }}</TD>
                        <TD>{{ item.endDate }}</TD>
                        <TD noWrap align=middle><A
                                href="http://169.254.158.100/zzdl/Demand/Xyprice_list.asp?itemcode={{ item.code }}"></A></TD>
                        <TD>{{ item.totalPrice }}</TD>
                        <TD>{{ item.unitPrice }}</TD></TR>
                    </TBODY></TABLE>
            </td></tr></table>
    <TABLE style="LINE-HEIGHT: 30px" cellSpacing=1 cellPadding=0     width="100%"  bgColor=#336699 borderColorLight=#006699 border=0>
        <tr>
            <td>
                <table cellpadding="3" cellspacing="1" border="0" width="100%">
                    <tr class="t2">
                        <td nowrap>报价有效期</td>
                        <td>{{ Enquires.QuoteValidity }}</td>
                    </tr>
                    <tr class="t2">
                        <td nowrap>询价说明</td>
                        <td style="width:100%"><textarea name="textarea" rows="4" readonly style="width:100%">{{ Enquires.remark }}</textarea>&nbsp;</td>
                    </tr>
                </table></td></tr></table>
    <CENTER>
        <BR>&nbsp;<INPUT id="button1" onclick="window.history.back()" type="button" value="返回" name="button1">
    </CENTER>
</div>
<script Language="JavaScript" src="../js/pub_Calendar.js"></script>
<script>
    const vm = new Vue({
        el: '#app', // 挂载到 <div id="app"></div>
        data: {
            Enquires: {
                EnquireNo: '',
                EnquireName: '',
                Company: '',
                ContactPerson: '',
                Address: '',
                Tel: '',
                Fax: '',
                PostCode: '',
                Email: '',
                Deadline: '',
                QuoteValidity: '',
                remark: ''
            },
            items: [],
            isLoading: false,
            quoteNo: ''
        },
        created() {
            this.selectAll();
            this.selectList();
        },
        methods: {
            selectList(){
                console.log("调用了selectList()函数");
                axios.get(`/put/selectByContId?id=${sessionStorage.getItem('cont_id')}`)
                    .then(response => {
                        this.items = response.data.data;
                    })
            },
            selectAll() {
                console.log("调用了selectAll()函数");
                axios.get(`/put/selectByEnquireName?enquireName=${sessionStorage.getItem('ENQUIRE_NUM')}`)
                    .then(response => {
                        const mapData = response.data.data;
                        this.Enquires = {
                            EnquireNo: mapData.enquireNum,
                            EnquireName: mapData.enquireName,
                            Company: mapData.company,
                            ContactPerson: mapData.linkman,
                            Address: mapData.address,
                            Tel: mapData.phone,
                            Fax: mapData.fax,
                            PostCode: mapData.zip,
                            Email: mapData.email,
                            Deadline: mapData.endDate,
                            QuoteValidity: mapData.queDate,
                            remark: mapData.remark

                        };
                    })
                    .catch(error => {
                        console.error("Error fetching data:", error);
                    });
            },
            QuotePrint(p_QuoteNo) {
                window.open("Quote_Print.ASP?QuoteNo=" + p_QuoteNo, "", "toolbar=0,resizable=yes,location=0,status=0,menubar=1,scrollbars=1,width=800,height=600,left=0,top=0");
            },
            fetchQuoteData() {
                this.isLoading = true;
                axios.get('/api/quote-data')
                    .then(response => {
                        this.items = response.data;
                        this.isLoading = false;
                    })
                    .catch(error => {
                        console.error("Error fetching data:", error);
                        this.isLoading = false;
                    });
            }
        },
        mounted() {
            this.fetchQuoteData();
        }
    });
</script>
</BODY></HTML>